﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CategoryList.aspx.cs" Inherits="Admin_CategoryList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>资讯分类列表</title>
    <script src="../script/jquery-1.9.1.min.js" type="text/javascript"></script>
    <link href="skin/css/main.css" rel="stylesheet" type="text/css" />
    <link href="skin/css/base.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div class="Header">
            分类名称：<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
            &nbsp;<asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" />
        </div>
        <table cellpadding="1" cellspacing="1">
            <tr class="trHeader">
                <td style="width: 5%">
                    序号
                </td>
                <td style="width: 70%">
                    类别名称
                </td>
                <td style="width: 15%">
                    操作
                </td>
            </tr>
            <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand">
                <ItemTemplate>
                    <tr>
                        <td>
                            <%#Eval("Id")%>
                        </td>
                        <td>
                            <%#Eval("CategoryName")%>
                        </td>
                        <td>
                            <asp:Button ID="btnEdit" runat="server" Text="编辑" CausesValidation="false"  CommandArgument='<%#Eval("Id")%>'
                                CommandName="Edit" />
                            <asp:Button ID="btnDel" runat="server" CausesValidation="false" Text="删除" CommandArgument='<%#Eval("Id")%>'
                                CommandName="Del" />
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
        <webdiyer:AspNetPager ID="ApNetPager1" runat="server" 
            OnPageChanged="ApNetPager1_PageChanged" FirstPageText="首页" LastPageText="尾页" 
            NextPageText="下一页" PrevPageText="上一页">
        </webdiyer:AspNetPager>
        <asp:HiddenField ID="HCategoryId" runat="server" />
    </div>
    <br />
    <div id="editcategroy">
        <table cellpadding="1" cellspacing="1" style="width: 30%; margin: 0,auto;">
            <tr>
                <td>
                    分类名称:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtCategoryName"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCategoryName"
                        Display="Dynamic" ErrorMessage="不可以为空" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:Label runat="server" ID="lblAlert"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
